package org.csmzxy.class2333;
public class Example01 {
    public static void main(String[] args) {
        int[] arr = {1,13,2,3,8};
        for (int i=0; i< arr.length-1; i++){
            if (arr[i]>arr[i+1]){
                int tmp = arr[i];
                arr[1] = arr[i+1];
                arr[i+1] = tmp;
            }
        }
        System.out.println(arr[arr.length-1]);
        int max = arr[0];
        for (int i=0; i< arr.length; i++) {
            if (arr[i]>max){
                max = arr[i];
            }
        }
        System.out.println("最大值：" + max);
        int min = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] < min) {
                min = arr[i];
            }
        }
        System.out.println("最小值: " + min);
    }
}
